From 4a9bf575bd24b2e24348c65d9fbbf9c81a73cb35 Mon Sep 17 00:00:00 2001
From: Sebastien Castiel <sebastien@castiel.me>
Date: Tue, 30 Jan 2024 16:36:29 -0500
Subject: Create expense from receipt (#69)

* Create expense from receipt

* Add modal

* Update README
---
 src/app/groups/[groupId]/expenses/expense-list.tsx | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

(limited to 'src/app/groups/[groupId]/expenses/expense-list.tsx')

diff --git a/src/app/groups/[groupId]/expenses/expense-list.tsx b/src/app/groups/[groupId]/expenses/expense-list.tsx
index 0dc7a7e..a97c2bd 100644
--- a/src/app/groups/[groupId]/expenses/expense-list.tsx
+++ b/src/app/groups/[groupId]/expenses/expense-list.tsx
@@ -3,7 +3,7 @@ import { CategoryIcon } from '@/app/groups/[groupId]/expenses/category-icon'
 import { Button } from '@/components/ui/button'
 import { SearchBar } from '@/components/ui/search-bar'
 import { getGroupExpenses } from '@/lib/api'
-import { cn } from '@/lib/utils'
+import { cn, formatExpenseDate } from '@/lib/utils'
 import { Expense, Participant } from '@prisma/client'
 import dayjs, { type Dayjs } from 'dayjs'
 import { ChevronRight } from 'lucide-react'
@@ -159,7 +159,7 @@ export function ExpenseList({
                     {currency} {(expense.amount / 100).toFixed(2)}
                   </div>
                   <div className="text-xs text-muted-foreground">
-                    {formatDate(expense.expenseDate)}
+                    {formatExpenseDate(expense.expenseDate)}
                   </div>
                 </div>
                 <Button
@@ -189,10 +189,3 @@ export function ExpenseList({
     </p>
   )
 }
-
-function formatDate(date: Date) {
-  return date.toLocaleDateString('en-US', {
-    dateStyle: 'medium',
-    timeZone: 'UTC',
-  })
-}
-- 
cgit v1.3

